package com.aaa.orderservice.service;

import com.aaa.orderservice.mapper.OrderMapper;
import com.aaa.orderservice.po.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author: YuXin
 * @Date : Created in 2020/11/3 16:31
 * @ClassName : OrderServiceImpl
 * @Description :
 * @Package_Name : com.aaa.orderservice.service
 */
@Service
@Transactional //事务注解
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> selectAll() {
        List<Order> orders = orderMapper.selectAll();
        Order order = new Order();
        order.setId(2223);
        order.setMemberUsername("提供者2223");
        orders.add(order);
        return orders;
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return orderMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Order record) {
        return orderMapper.insert(record);
    }

    @Override
    public int insertSelective(Order record) {
        return orderMapper.insertSelective(record);
    }

    @Override
    public Order selectByPrimaryKey(Integer id) {
        return orderMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Order record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(Order record) {
        return 0;
    }
}
